# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10 18:39:19 2023

@author: 楠川之木
"""

def demo(v): 
  capital = little = digit = other =0 
  for i in v: 
     if 'A'<=i<='Z': 
        capital+=1 
     elif 'a'<=i<='z': little+=1 
     elif '0'<=i<='9': digit+=1 
     else: other+=1 
  return (capital,little,digit,other) 

s = input()
print(demo(s))